PlaceAddPortlet = Class.extend({
	init: function()	{
		this.name = "PlaceAddPortlet";
	},
	
	onBegin: function()	{
		this.registerObserver();
	},
	
	run: function()	{
		this.getPortletPlaceholder().paintCanvas(this.render());
	},
	
	onAddPlaceClicked: function()	{
		var name = this.requestForEffectiveResource('Name');
		var address = this.requestForEffectiveResource('Address');
		var description = this.requestForEffectiveResource('Description');
		var lat = this.requestForEffectiveResource('Lat');
		var lng = this.requestForEffectiveResource('Lng');
		
		var obj = this;
		this.onAjax('admin', 'add-place', {name: name, address: address, description: description, lat: lat, lng: lng}, 'POST', {
			'onSuccess': function(ret)	{
//				alert('Thêm thành công!');
			}
		});
	},
	
	onEnd: function()	{
		this.unregisterObserver();
	}
}).implement(PortletInterface).implement(RenderInterface).implement(AjaxInterface).implement(ObserverInterface);